{
  "properties" : { },
  "id" : "eca6c3b8c5df4a49afcd82cc68679632",
  "script" : null,
  "groupId" : "106cbee51dd144a4a3c4c0c6e79f14c0",
  "name" : "通道管理状态设置",
  "createTime" : 1727071020065,
  "updateTime" : 1725434928858,
  "lock" : "1",
  "createBy" : "ndmp",
  "updateBy" : "ndmp",
  "path" : "updateDaLinkStatus",
  "method" : "POST",
  "parameters" : [ ],
  "options" : [ ],
  "requestBody" : "{\r\n    \"daLinkIdList\": [\r\n        \"3469572910449918736\",\r\n        \"3431386348837009683\"\r\n    ],\r\n    \"taskIdList\": [\r\n        \"D1557368675444724547\",\r\n        \"D6586135615657514458\"\r\n    ],\r\n    \"status\": 1\r\n}",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : "{\n    \"status\": 200,\n    \"message\": \"修改成功\",\n    \"data\": \"修改成功\"\n}",
  "description" : "",
  "requestBodyDefinition" : {
    "name" : "",
    "value" : "",
    "description" : "",
    "required" : false,
    "dataType" : "Object",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ {
      "name" : "daLinkIdList",
      "value" : "",
      "description" : "",
      "required" : false,
      "dataType" : "Array",
      "type" : "",
      "defaultValue" : "",
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ {
        "name" : "",
        "value" : "3469572910449918736",
        "description" : "",
        "required" : false,
        "dataType" : "String",
        "type" : "",
        "defaultValue" : "",
        "validateType" : "",
        "error" : "",
        "expression" : "",
        "children" : [ ]
      } ]
    }, {
      "name" : "taskIdList",
      "value" : "",
      "description" : "",
      "required" : false,
      "dataType" : "Array",
      "type" : "",
      "defaultValue" : "",
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ {
        "name" : "",
        "value" : "D1557368675444724547",
        "description" : "",
        "required" : false,
        "dataType" : "String",
        "type" : "",
        "defaultValue" : "",
        "validateType" : "",
        "error" : "",
        "expression" : "",
        "children" : [ ]
      } ]
    }, {
      "name" : "status",
      "value" : "0",
      "description" : "",
      "required" : false,
      "dataType" : "Integer",
      "type" : "",
      "defaultValue" : "",
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    } ]
  },
  "responseBodyDefinition" : {
    "name" : "",
    "value" : "",
    "description" : "",
    "required" : false,
    "dataType" : "Object",
    "type" : null,
    "defaultValue" : null,
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ {
      "name" : "status",
      "value" : "200",
      "description" : "",
      "required" : false,
      "dataType" : "Integer",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "message",
      "value" : "修改成功",
      "description" : "",
      "required" : false,
      "dataType" : "String",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "data",
      "value" : "修改成功",
      "description" : "",
      "required" : false,
      "dataType" : "String",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    } ]
  }
}
================================
 import response;
 if(body==null){
     return false;
 }
 if (body.taskIdList!=null) {
     var tx = db.transaction(); 
     try{
     var sql1="""
     update  ndmp_device set open_status= #{body.status} where id  in
        <foreach item="taskId" index="index" collection="body.taskIdList" open="(" separator="," close=")">
            #{taskId}
        </foreach>
     """;
     db.update(sql1);
     var sql2="""
       update  da_link  set  is_open = #{body.status}  where  task_id  in
        <foreach collection="body.taskIdList" index="index" item="id" open="(" close=")" separator=",">
            #{id}
        </foreach>
     """;
    db.update(sql2);
    tx.commit();   
    return response.json({
    "status": 200,
    "message": "修改成功",
    "data":  "修改成功"
});
   }catch(e){
    tx.rollback();  
};
    return val;
        } else {
            return response.json({
    "status": 500,
    "message": "请重新勾选",
    "data":  "请重新勾选"
});
}